package com.cim.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

//全局配置-静态变量
@Component
@PropertySource(value={"classpath:config.properties"})
public class GlobalConfig {
    //RTMP服务器地址(公网)
    public static String RTMPServiceAddress="rtmp://49.234.222.55:1935/stream/";
    //TOKEN秘钥
    public static String TOKEN_SECRET="ZCfasfhuaUUHufguGuwu2020BQWE";
    //TOKEN用户名KEY
    public static String TOKEN_USER="userName";
    //TOKEN角色KEY
    public static String TOKEN_ROLE="role";
    //TOKEN密码KEY
    public static String TOKEN_PASS="password";
    //本地存储服务路径(绝对)
    public static String SYSTEM_STORAGE_PATH = "/storage/";
    //RTMP服务器录制视频目录
    public static String RTMP_RECORD_PATH="/data/";

    @Value("${config.RTMPServiceAddress}")
    public void set_RTMPServiceAddress(String RTMPServiceAddress){
        GlobalConfig.RTMPServiceAddress=RTMPServiceAddress;
    }

    @Value("${config.TOKEN_SECRET}")
    public void set_TOKEN_SECRET(String TOKEN_SECRET){
        GlobalConfig.TOKEN_SECRET=TOKEN_SECRET;
    }

//    @Value("${config.TOKEN_USER}")
//    public void set_TOKEN_USER(String TOKEN_USER){
//        GlobalConfig.TOKEN_USER=TOKEN_USER;
//    }
//
//    @Value("${config.TOKEN_ROLE}")
//    public void set_TOKEN_ROLE(String TOKEN_ROLE){
//        GlobalConfig.TOKEN_ROLE=TOKEN_ROLE;
//    }
//
//    @Value("${config.TOKEN_PASS}")
//    public void set_TOKEN_PASS(String TOKEN_PASS){
//        GlobalConfig.TOKEN_PASS=TOKEN_PASS;
//    }

    @Value("${config.SYSTEM_STORAGE_PATH}")
    public void set_SYSTEM_STORAGE_PATH(String SYSTEM_STORAGE_PATH){
        GlobalConfig.SYSTEM_STORAGE_PATH=SYSTEM_STORAGE_PATH;
    }

    @Value("${config.RTMP_RECORD_PATH}")
    public void set_RTMP_RECORD_PATH(String RTMP_RECORD_PATH){
        GlobalConfig.RTMP_RECORD_PATH=RTMP_RECORD_PATH;
    }
}
